<!DOCTYPE html>
<html>
    
    <head>
        <meta charset="UTF-8">
        <title>小鱼ADMIN</title>
        <meta name="renderer" content="webkit">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
        <link rel="stylesheet" href="/public/static/css/font.css">
        <link rel="stylesheet" href="/public/static/css/bgadmin.css">
		<link href="/public/static/lib/address/css/city-picker.css" rel="stylesheet" type="text/css" />
        <script type="text/javascript" src="/public/static/js/jquery-1.8.0.min.js"></script>
        <script src="/public/static/js/js/jquery-1.9.1.min.js"></script>
        <script type="text/javascript" src="/public/static/lib/layui/layui.js" charset="utf-8"></script>
        <script type="text/javascript" src="/public/static/js/bgadmin.js"></script>
        <script type="text/javascript" src="/public/static/js/jquery.form.js"></script>
		<script type="text/javascript" src="/public/static/js/pbx.js"></script>
		<script type="text/javascript">
			var CTI_IP = "192.168.88.59:8888"; 
			var exten = "{$_SESSION['user_info']['extension']}";
			
		</script>
    </head>
    
    <body>
        <div class="bg-body">
            <form  action="#" method="post" id="basicCustomer" class="layui-form">
                <input type="hidden" name="customer_code" value="{$customerData.customer_code}">
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">
                            客户编码：
                        </label>
                        <div class="layui-input-inline">
                            <input type="text" value="{$customerData.customer_code}" disabled class="layui-input layui-bg-gray">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">
                            <span class="bg-red">*&nbsp;&nbsp;</span>客户姓名：
                        </label>
                        <div class="layui-input-inline">
                            <input type="text" id="name" name="name" value="{$customerData.name}" lay-verify="required" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    
                    {if condition="($username eq 'admin') OR ($priv['display_phone'] eq 'Y')"}
                    <div class="layui-inline">
                        <label class="layui-form-label">
                            <span class="bg-red">*&nbsp;&nbsp;</span>客户手机：
                        </label>
                        <div class="layui-input-inline">
                            <input type="text" id="phone" name="phone" value="{$customerData.phone}" lay-verify="required" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">
                            客户电话：
                        </label>
                        <div class="layui-input-inline">
                            <input type="text" id="telephone" name="telephone" value="{$customerData.telephone}" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    {/if}
                    
                    <div class="layui-inline">
                        <label class="layui-form-label">
                            客户性别：
                        </label>
                        <div class="layui-input-inline">
                            <select name="sex" id="sex" autocomplete="off" class="layui-input">
                                <option value="">请选择</option>
                                {$customerData.option}
                            </select>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">
                            客户年龄：
                        </label>
                        <div class="layui-input-inline">
                            <input type="text" id="age" name="age" value="{$customerData.age}" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">
                            客户分组：
                        </label>
                        <div class="layui-input-inline">
                            <select name="groups" id="groups" autocomplete="off" class="layui-input" lay-filter="groups">
                                <option value="">未分组</option>
                                {volist name="arrGroups" id="vo"}
                                <option value="{$vo.id}">{$vo.group_name}</option>
                                {/volist}
                            </select>
                        </div>
                    </div>
                    <div class="layui-inline">
						<label class="layui-form-label">
							会员等级：
						</label>
						<div class="layui-input-inline">
							<input type="text" id="integral" name="integral" disabled value="{$customerData.member_level}" autocomplete="off" class="layui-input layui-bg-gray">
						</div>
					</div>
                    <div class="layui-inline">
                        <label class="layui-form-label">
                            当前积分：
                        </label>
                        <div class="layui-input-inline">
                            <input type="text" id="integral" name="integral" disabled value="{$customerData.integral}" autocomplete="off" class="layui-input layui-bg-gray">
                        </div>
                    </div>
                    <div class="layui-inline">
						<label class="layui-form-label">
							最后回访：
						</label>
						<div class="layui-input-inline">
							<input type="text" id="last_call_time" name="last_call_time" disabled value="{$customerData.last_call_time}" autocomplete="off" class="layui-input layui-bg-gray">
						</div>
					</div>
					<div class="layui-inline">
						<label class="layui-form-label">
							最后下单：
						</label>
						<div class="layui-input-inline">
							<input type="text" id="last_order_time" name="last_order_time" disabled value="{$customerData.last_order_time}" autocomplete="off" class="layui-input layui-bg-gray">
						</div>
					</div>
					<div class="layui-inline">
						<label class="layui-form-label">
							开单次数：
						</label>
						<div class="layui-input-inline">
							<input type="text" id="order_num" name="order_num" disabled value="{$customerData.order_num}" autocomplete="off" class="layui-input layui-bg-gray">
						</div>
					</div>
					<div class="layui-inline">
						<label class="layui-form-label">
							签收次数：
						</label>
						<div class="layui-input-inline">
							<input type="text" id="sign_num" name="sign_num" disabled value="{$customerData.sign_num}" autocomplete="off" class="layui-input layui-bg-gray">
						</div>
					</div>
					<div class="layui-inline">
						<label class="layui-form-label">
							会员类型：
						</label>
						<div class="layui-input-inline">
							<input type="text" id="customer_type" name="customer_type" disabled value="{$customerData.customer_type}" autocomplete="off" class="layui-input layui-bg-gray">
						</div>
					</div>
					<div class="layui-inline">
						<label class="layui-form-label">
							所属客服：
						</label>
						<div class="layui-input-inline">
							<input type="text" id="createuser" name="createuser" disabled value="{$customerData.createuser}" autocomplete="off" class="layui-input layui-bg-gray">
						</div>
					</div>
                    <div class="layui-inline">
                        <label class="layui-form-label">
                            回访任务：
                        </label>
                        <div class="layui-input-inline">
                            <input type="text" id="task_id" name="task_id" disabled value="{$customerData.task_id}" autocomplete="off" class="layui-input layui-bg-gray">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">
                            数据任务：
                        </label>
                        <div class="layui-input-inline">
                            <input type="text" id="data_task" name="data_task" disabled value="{$customerData.data_task}" autocomplete="off" class="layui-input layui-bg-gray">
                        </div>
                    </div>
                </div>

                 {if condition="$customerData['transfer_note']"}
				<div class="layui-form-item layui-form-text">
					<label class="layui-form-label">
						转交备注：
					</label>
					<div class="layui-input-block" style="">
						<input class="layui-input" name="transfer_note" value="{$customerData.transfer_note}" disabled style="width:50%">
					</div>
				</div>
				{/if}
				<div class="layui-form-item">
					<label class="layui-form-label">
						<span class="bg-red">*&nbsp;&nbsp;</span>所在地区：
					</label>
					<div class="layui-input-block">
						<div style="position: relative;">
							<input id="city-picker3" style="width:50%;line-height:30px;" class="form-control" name="location_address" readonly type="text" value="{$address.province}/{$address.city}/{$address.area}" data-toggle="city-picker">
						</div>
					</div>
				</div>
				<div class="layui-form-item layui-form-text">
					<label class="layui-form-label">
						详细地址：
					</label>
					<div class="layui-input-block" id="address_select" style="">
						<input class="layui-input"  placeholder="建议您如实填写详细收货地址，例如街道名称，门牌号码，楼层和房间号等信息" name="address_details" value="{$address.address_details}" lay-verify="required" style="width:50%">
					</div>
				</div>
				
				<div class="layui-form-item">
					<label class="layui-form-label"></label>
					<a class="layui-btn" lay-submit="" id="saveCustomer" lay-filter="saveCustomer"><i class="iconfont1">&#xe6b2; </i>保存</a>
					<a class="layui-btn layui-btn-warm" onclick="call1('{$customerData.customer_code}');"><i class="iconfont1">&#xe6f1; </i>拨号1</a>
                    <a class="layui-btn layui-btn-warm" lay-submit="" id="" lay-filter=""><i class="iconfont1">&#xe6ec; </i>拨号2</a>
				</div>
            </form>
        </div>
        <div class="bg-body">
            <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief" style="margin-top: -30px">
              <ul class="layui-tab-title">
                {if condition="($username eq 'admin') OR ($priv['view_illness'] eq 'Y')"}
                <li onclick="loadIframe('iframe_illness', './illness.html?customer_code={$customerData.customer_code}')" class="layui-this">客户病情</li>
                {/if}
                {if condition="($username eq 'admin') OR ($priv['view_visit'] eq 'Y')"}
                <li onclick="loadIframe('iframe_visit', './visit.html?customer_code={$customerData.customer_code}')">回访记录</li>
                {/if}
                {if condition="($username eq 'admin') OR ($priv['view_order'] eq 'Y')"}
                <li onclick="loadIframe('iframe_add_order', '../orderManager/addOrder.html?customer_code={$customerData.customer_code}')">添加订单</li>
                {/if}
                {if condition="($username eq 'admin') OR ($priv['view_order'] eq 'Y')"}
                <li onclick="loadIframe('iframe_order', '../serviceOrder/orderList.html?customer_code={$customerData.customer_code}')">历史订单</li>
                {/if}
              </ul>
              <div class="layui-tab-content" style="height: 100px;">
                {if condition="($username eq 'admin') OR ($priv['view_illness'] eq 'Y')"}
                <div class="layui-tab-item layui-show">
                    <iframe id="iframe_illness" src="./illness.html?customer_code={$customerData.customer_code}" style="width:100%;height:370px;" scrolling="auto" frameborder="0" ></iframe>
                    <!-- <iframe id="iframe_illness" src="./illness.html?customer_id={$customerData.id}" style="width:100%;height:370px;" scrolling="auto" frameborder="0" ></iframe> -->
                </div>
                {/if}
                {if condition="($username eq 'admin') OR ($priv['view_visit'] eq 'Y')"}
                <div class="layui-tab-item">
                    <iframe id="iframe_visit" src="" style="width:100%;height:370px;" scrolling="auto" frameborder="0" ></iframe>
                    <!-- <iframe id="iframe_visit" src="./visit.html?customer_id={$customerData.id}" style="width:100%;height:370px;" scrolling="auto" frameborder="0" ></iframe> -->
                </div>
                {/if}
                {if condition="($username eq 'admin') OR ($priv['view_order'] eq 'Y')"}
                <div class="layui-tab-item">
                    <iframe id="iframe_add_order" src="" style="width:100%;height:580px;" scrolling="auto" frameborder="0" ></iframe>
                    <!-- <iframe id="iframe_add_order" src="../orderManager/addOrder.html?customer_id={$customerData.id}" style="width:100%;height:580px;" scrolling="auto" frameborder="0" ></iframe> -->
                </div>
                {/if}
                {if condition="($username eq 'admin') OR ($priv['view_order'] eq 'Y')"}
                <div class="layui-tab-item">
                    <iframe id="iframe_order" src="" style="width:100%;height:580px;" scrolling="auto" frameborder="0" ></iframe>
                    <!-- <iframe id="iframe_order" src="../orderManager/orderList.html?customer_id={$customerData.id}" style="width:100%;height:580px;" scrolling="auto" frameborder="0" ></iframe> -->
                </div>
                {/if}
              </div>
            </div>
        </div>
    </body>
    <script type="text/javascript" src="/public/static/crm/js/servicecustomer/editCustomer.js"></script>
    <script src="/public/static/lib/address/js/city-picker.data.js"></script>
	<script src="/public/static/lib/address/js/city-picker.js"></script>
	<script src="/public/static/lib/address/js/main.js"></script>
    <script>
        var groups = '{$customerData.groups}';
        // alert(groups)
        layui.use('form', function(){
            var form = layui.form;
            $('#groups').val(groups);
            form.render();
        });

        var exten = "{$_SESSION['user_info']['extension']}";
        function call1(customer_code){
            $.ajax({
                type : 'post',
                url : '/index.php/crm/Pbx/call1',
                data : {src_exten:exten,customer_code:customer_code},
                dataType : 'json',
                success : function (result) {
                    if (result.success) {  
                        
                    } else {  
                        
                    }
                }
            })
            
        }
    </script>
</html>
